<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="obj.isDone?'completed':''" v-for="(obj,ind) in arr" :key="obj.id" >
      <div class="view">
        <input class="toggle" type="checkbox" v-model="obj.isDone" />
        <label>{{obj.name}}</label>
        <button class="destroy" @click="delFn(ind)"></button>
      </div>
    </li>
  </ul>

</template>

<script>
export default {
  props:["arr"],
  methods:{
    delFn(index){
      this.$emit("dellist",index)
    }
  }
}
</script>